<?php
include('../common/_const.php');
include('../common/common.php');
include('../common/checksession.php');
checksession("../index.php");
include('../../inc/conn.php');

$rootname=excode($_GET['id']);

$db=db_connect();
$sql=select_sql("`rootname`,`email`","`".PRETABLE."adminuser`","`rootname`='".$rootname."'");
$rs=$db->query($sql);

if(!islogintxt($rootname)||$rs->num_rows==0){
	ShowMsg("账号错误！","member.php");
	exit;
}
$row=$rs->fetch_assoc();

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $sys_title['change_member'];?></title>
<link href="../images/css1/css.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function checkform(o){
	if(o.idname.value==""){
		alert("请输入账号！");
		o.idname.select();
		o.idname.focus();
		return false;
	}
	if(o.pwd.value==""||o.pwd.value.length<5){
		alert("请正确输入原密码！");
		o.pwd.select();
		o.pwd.focus();
		return false;
	}
	
	if(o.n_pwd.value==""||o.n_pwd.value.length<5){
		alert("密码不能少于5位数！");
		o.n_pwd.select();
		o.n_pwd.focus();
		return false;
	}
	if(o.n_pwd.value!=o.nr_pwd.value){
		alert("两次密码不一样！");
		o.nr_pwd.value="";
		o.n_pwd.select();
		o.n_pwd.focus();
		return false;
	}
}

</script>
</head>

<body>
<form action="../action/ac_member_change.php" method="post" onsubmit="return checkform(this)">
<table class="table" cellspacing="1" cellpadding="2" width="99%" align="center" 
border="0">
  <tbody>
    <tr>
      <th class="bg_tr" align="left" colspan="2" height="25">
      	&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $sys_title['change_member'];?>
      </th>
    </tr>
    <tr>
    		<td width="17%" height="23" align="right" class="td_bg">账号：<span class="TableRow2"></span></td>
    		<td width="83%"class="td_bg">
    				<input type="text" name="idname" class="cat_input" style="width:280px; float:left;" value="<?php echo $row['rootname'] ?>"  disabled="disabled"/>
    				
    				</td>
    		</tr>
    <tr>
      <td width="17%" height="23" align="right" class="td_bg">原始密码：<span class="TableRow2"></span></td>
      <td class="td_bg" width="83%"><input name="pwd" type="password" class="cat_input" style="width:280px; float:left;" value="" /></td>
    </tr>
	 <tr>
      <td width="17%" height="23" align="right" class="td_bg">新密码：<span class="TableRow2"></span></td>
      <td class="td_bg" width="83%"><input name="n_pwd" type="password" class="cat_input" style="width:280px; float:left;" value="" /></td>
    </tr>
	 <tr>
      <td width="17%" height="23" align="right" class="td_bg">确认密码：<span class="TableRow2"></span></td>
      <td class="td_bg" width="83%"><input name="nr_pwd" type="password" class="cat_input" style="width:280px; float:left;" value="" /></td>
    </tr>
    <tr>
      <td width="17%" height="23" align="right" class="td_bg">E-mail：<span class="TableRow2"></span></td>
      <td class="td_bg" width="83%"><input name="email" type="text" class="cat_input" style="width:280px; float:left;" value="<?php echo $row['email']; ?>" /></td>
    </tr>
     <tr>
     		<td class="td_bg" width="17%" height="23"></td>
     		<td class="td_bg" width="83%">
     				<input type="submit" name="submit" value="提交" class="btn" />
     				<input type="reset" value="重置" class="btn" />
     				<input type="hidden" name="gurl" value="<?php echo GetCurUrl(); ?>" />
					<input type="hidden" name="rootname" value="<?php echo $rootname; ?>" />
     				</td>
     		</tr>
  </tbody>
</table>
</form>
</body>
</html>